package com.indusfo.spc.controller;


import com.indusfo.spc.service.WebClientAnoDetailService;
import com.indusfo.spc.client.pojo.ClientAnoDetail;
import com.indusfo.spc.vo.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author wangq
 * @create 2020-1-3
 */
@Controller
@RequestMapping("/service/clientAnoDetail")
public class ClientAnoDetailController {

    @Autowired
    private WebClientAnoDetailService clientAnoDetailService;

    /**
     *	 删除异常单明细
     * @param clientAnoDetailIds
     * @param dataState
     * @return
     */
    @RequestMapping("/deleteClientAnoDetail")
    @ResponseBody
    public JSONObject deleteClientAnoDetail(Long[] clientAnoDetailIds, Integer dataState) {
        dataState = 2;
        JSONObject jsonObject = clientAnoDetailService.definedClientAnoDetail(clientAnoDetailIds, dataState);
        return jsonObject;
    }

    /**
     * 启用停用异常单明细
     * @param clientAnoDetailIds
     * @param dataState
     * @return
     */
    @RequestMapping("/definedClientAnoDetail")
    @ResponseBody
    public JSONObject definedClientAnoDetail(Long[] clientAnoDetailIds, Integer dataState) {
        JSONObject jsonObject = clientAnoDetailService.definedClientAnoDetail(clientAnoDetailIds, dataState);
        return jsonObject;
    }

    /**
     *	 新增异常单明细
     * @param clientAnoDetail
     * @return
     */
    @RequestMapping("/insertClientAnoDetail")
    @ResponseBody
    public JSONObject insertClientAnoDetail(ClientAnoDetail clientAnoDetail) {
        JSONObject jsonObject = clientAnoDetailService.insertClientAnoDetail(clientAnoDetail);
        return jsonObject;
    }

    /**
     * 	修改异常单明细
     * @param clientAnoDetail
     * @return
     */
    @RequestMapping("/updateClientAnoDetail")
    @ResponseBody
    public JSONObject updateClientAnoDetail(ClientAnoDetail clientAnoDetail) {
        JSONObject jsonObject = clientAnoDetailService.updateClientAnoDetail(clientAnoDetail);
        return jsonObject;
    }

}
